package com.example.excelStudy;

import lombok.Data;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 按照滞留时间数据模型
 * @author brad zhang
 * @version 2.0
 * @date 2021/11/23 18:45
 */
@Data
public class RetentionTimeHandVO {
    /**
     * 是否需要这个配置
     */
    private Boolean isNeed = false;
    /**
     * 消息配置
     */
    private MessageConfig messageConfig;
    private LocalDateTime time;
    /**
     * 单位
     */
    private UnitEnum unit;

    /**
     * 值
     */
    private Integer value;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RetentionTimeHandVO that = (RetentionTimeHandVO)o;
        return Objects.equals(isNeed, that.isNeed) && Objects.equals(messageConfig, that.messageConfig) && Objects.equals(
            time, that.time) && unit == that.unit && Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(isNeed, messageConfig, time, unit, value);
    }
}
